package bean;

import cyclic.A;
import cyclic.B;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestBean {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        /*Bean bean = (Bean)applicationContext.getBean("bean");
        System.out.println(bean.getName());*/
        //applicationContext.close();
        A a = (A)applicationContext.getBean("a");
        B b = (B)applicationContext.getBean("b");
        System.out.println(a.getB().getName());
        System.out.println(b.getA().getName());
    }
}
